package com.ddstation.home_page.enumerate;

import org.apache.commons.lang3.StringUtils;

public enum ChartInfoEnum {
    COMPREHENSIVE_DISPLAY("00", "综合展示"),
    QRCODE_SUPERVISION("51", "社会监督 => 二维码监督"),
    COMPREHENSIVE_APPLICATION("60", "综合应用"),
    MEDICAL_HIS("22","机构自制 => 医疗His"),
    PRESRCIPTION_SUPERVISION("411","政府监管 => 行政执法 => 诊疗行为监管"),
    ACCOUNT_SUPERVISION("412","政府监管 => 行政执法 => 卫生消毒监督"),
    INSTITUTION_REVIEW("10","机构统查");

    private String id;
    private String name;

    private ChartInfoEnum(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static ChartInfoEnum valId(Integer id) {
        if (null == id) {
            return null;
        }
        for (ChartInfoEnum opEnum: values()) {
            if (opEnum.getId().equals(id)) {
                return opEnum;
            }
        }
        return null;
    }

    public static ChartInfoEnum valName(String name) {
        if (StringUtils.isEmpty(name)) {
            return null;
        }
        for (ChartInfoEnum opEnum: values()) {
            if (opEnum.getName().equals(name)) {
                return opEnum;
            }
        }
        return null;
    }
}
